package com.apps.datastore.dao;

public class UniqueCourseObject {

	private String departmentName;
	private String courseNumber;
	private String sectionNumber;

	public UniqueCourseObject() {
	}

	public UniqueCourseObject(String d, String c, String s) {
		this.courseNumber = c;
		this.departmentName = d;
		this.sectionNumber = s;
	}

	public String getCourseNumber() {
		return courseNumber;
	}

	public String getDepartmentName() {
		return departmentName;
	}

	public String getSectionNumber() {
		return sectionNumber;
	}

	public void setCourseNumber(String courseNumber) {
		this.courseNumber = courseNumber;
	}

	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}

	public void setSectionNumber(String sectionNumber) {
		this.sectionNumber = sectionNumber;
	}

//	public boolean equals(UniqueCourseObject uco) {
//		return (this.departmentName.equals(uco.getDepartmentName())
//				&& this.courseNumber.equals(uco.getCourseNumber()) && this.sectionNumber
//					.equals(uco.getSectionNumber()));
//	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((courseNumber == null) ? 0 : courseNumber.hashCode());
		result = prime * result
				+ ((departmentName == null) ? 0 : departmentName.hashCode());
		result = prime * result
				+ ((sectionNumber == null) ? 0 : sectionNumber.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UniqueCourseObject other = (UniqueCourseObject) obj;
		if (courseNumber == null) {
			if (other.courseNumber != null)
				return false;
		} else if (!courseNumber.equals(other.courseNumber))
			return false;
		if (departmentName == null) {
			if (other.departmentName != null)
				return false;
		} else if (!departmentName.equals(other.departmentName))
			return false;
		if (sectionNumber == null) {
			if (other.sectionNumber != null)
				return false;
		} else if (!sectionNumber.equals(other.sectionNumber))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "departmentName=" + this.departmentName + " courseNumber="
				+ this.courseNumber + " sectionNumber" + this.sectionNumber;

	}
}
